﻿namespace CubeStone.Wang.Utilities
{
    public static class CheckValueExtension
    {
        /// <summary>
        /// 检查当前对象是否为Null，或者string是NullOrEmpty
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static bool CheckValue<T>(this  T obj)
        {
            if (obj is string)
            {
                return (!string.IsNullOrEmpty(obj as string));
            }
            return (obj != null);
        }
    }
}